<template>
  <div>
      <button @click="handleClick">返回</button>
      <div v-for="item of detail" :key="item._id">
        <img :src="item.pic" alt="">
        <p>{{item.title}}</p>
        <p>{{item.slogo}}</p>
      </div>
  </div>
</template>

<script>
export default {
  data(){
    return {
      detail:[]
    }
  },
    methods:{
        handleClick(){
            this.$router.back();
        }
    },
    mounted(){
      // console.log(this.$route.query)
      var {id} = this.$route.query;
      this.$http(`/api/movieDetail?id=${id}`).then(res=>{
        // console.log(res.data.res);
        this.detail = res.data.res
      })
    }
}
</script>

<style scoped>
  button{
    width: 60px;
    height: 30px;
    border: 1px solid orange;
    color: orange;
    position: absolute;
  }
  img{
    width: 100%;
  }
  p{
    font-size: 17px;
  }
</style>